package com.ruibang.glass.portal.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruibang.glass.portal.entity.ParamEntity;
import com.ruibang.glass.portal.mapper.ParamMapper;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Auther: csz
 * @Date: 2018/8/21 09:32
 * @Description:
 */
@Service("paramService")
@Slf4j
public class ParamService extends ServiceImpl<ParamMapper, ParamEntity> implements IService<ParamEntity> {

    /**
     * 根据name修改value值
     *
     * @param name
     * @param value
     */
    @Synchronized
    public void updateByParams(String name, String value) {
        baseMapper.updateByParams(name, value);
    }

    /***
     * 根据名称获取对应值
     * @param name
     * @return
     */
    public String getByName(String name) {
        return baseMapper.getByName(name);
    }

    /***
     * 获取同步进度值
     * @return
     */
    public String getProgressValue() {
        return baseMapper.getProgressValue();
    }
}
